

from tools.showImg import ShowAndWait
from tools.preprocess import Preprocess


# 对身份证版面进行切片，分片的坐标根据版面调整
def Cut(img,size):

    image = Preprocess(img,size)

    name_img = image[80:180,210:500]
    ShowAndWait('name',name_img)

    gender_img = image[200:300,80:300]
    ShowAndWait('gend', gender_img)

    nation_img = image[200:300,350:650]
    ShowAndWait('nation', nation_img)

    birth_img = image[300:400,210:700]
    ShowAndWait('birth', birth_img)

    address_img = image[400:650,210:750]
    ShowAndWait('address', address_img)

    idnum_img = image[650:800,400:1100]
    ShowAndWait('idnum', idnum_img)

    pic_list = [name_img,gender_img,nation_img,birth_img,address_img,idnum_img]

    return  pic_list